﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

namespace BaseWeb.Ext.Test
{
    public partial class _2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var sqlStr = "select * from li_Menu";
                string sConnectionString = "Data Source=10.194.85.47;Initial Catalog=LiDataBase;Persist Security Info=True;User ID=prg;Password=prg";
                SqlConnection objConn = new SqlConnection(sConnectionString);
                try
                {
                    objConn.Open();
                    SqlDataAdapter da = new SqlDataAdapter(sqlStr, objConn);
                    DataSet ds = new DataSet();
                    lock (da)
                    {
                        da.Fill(ds);
                    }
                    objConn.Close();
                    this.GridView1.DataSource = ds;
                    this.GridView1.DataBind();
                }
                catch (Exception ex)
                {

                }
            }
        }
    }
}
